
package avenue;

import java.awt.Component;
import javax.swing.DefaultListCellRenderer;
import javax.swing.JList;
import model.Program;
/**
 *
 * @author Team-2
 */
public class ProgramBoxRender extends DefaultListCellRenderer{
    @Override
           public Component getListCellRendererComponent(
                   JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
               super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
               if (value instanceof Program) {
                   Program mp = (Program)value;
                   setText(mp.getName());
               }
               return this;
           }
}
